<template>
	<view class="wrap bggrey">
		<view class="padding" id="c_biaoge" >
			<view class="page-single-list">
				<text class="h3">{{title}}</text>
				<view class="links-nav" @tap="godetail(item.detid)" v-for="(item,index) in infoData">
					<view class="nav-a" style="margin-bottom: 0.4rem;">
						<navigator class="item-row" style="display: flex; align-items: center;">
							<view class="num">1</view>
							<text class="wrap-p">{{item.contentTitle}}</text>
							<text class="arrowright"></text>
						</navigator>
					</view>
				</view>
			</view>
			<view class="padding">
				<view class="fc-bet">
					<text class="bnt-order-blue fcc" @tap="previousPage">上一页</text>
					<text><text id="c_page">{{ pageSet.current }}</text>/{{pageSet.pages}}</text>
					<text class="bnt-order-blue fcc" @click="nextPag">下一页</text>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		inject: ['pageSet'],
		props: {
			title: String,
			infoData: Array,
			typeid:String
		},
		data() {
			return {
				
				num: 1
			}
		},
		methods: {
			previousPage() {
				
				this.pageSet.current>1?this.pageSet.current--:this.pageSet.current=1
			    console.log(this.pageSet.current);
				this.$emit('eveFun',this.pageSet.current)
			},
			nextPag() {
				
				 console.log(this.pageSet.current);
				 
				 if(this.pageSet.current<this.pageSet.pages){
					 this.pageSet.current++
				 }
				 this.$emit('eveFun',this.pageSet.current)
			},

			godetail(t) {
				uni.navigateTo({
					url: `/pages/tabBar/index/details?typeid=${this.typeid}&detid=${t}`// 指定目标页面的URL
				});
			}

		}
	}
</script>

<style scoped>
	.h3 {
		font-size: 0.64rem;
		font-weight: 900;
		letter-spacing: 0px;
		line-height: 0.92rem;
		color: #000000;
		margin-bottom: 0.56rem;
	}
  .item-row{
	      white-space: nowrap;
	      overflow: hidden;
	      text-overflow: ellipsis;
  }
	.nav-a {
		height: 1.72rem;
		display: flex;
		align-items: center;
		justify-content: space-between;
		border-radius: 0.28rem;
		background: #ffffff;
		padding: 0 0.6rem;
	}

	.wrap-p {
		font-size: 0.52rem;
		font-family: PingFang;
		font-weight: 500;
		color: #222222;
		line-height: 1.44rem;
		flex: 1;
		overflow: hidden;
		/* white-space: nowrap; */
		white-space: nowrap;
		text-overflow: ellipsis;
	}
</style>